package com.xuecheng.auth.api;

import com.xuecheng.auth.model.po.XcUser;
import com.xuecheng.auth.service.mapper.XcUserMapper;
import com.xuecheng.auth.service.service.XcUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class LoginController {

    @Autowired
    XcUserService xcUserService;

    @RequestMapping("/login-success")
    public String loginSuccess(){

        return "登录成功";
    }


    @RequestMapping("/user/{id}")
    public XcUser getuser(@PathVariable("id") String id){
        XcUser xcUser = xcUserService.selectById(id);
        return xcUser;
    }

    @RequestMapping("/r/r1")
    public String r1(){
        return "访问r1资源";
    }

    @RequestMapping("/r/r2")
    public String r2(){
        return "访问r2资源";
    }



}
